package com.example.springbootlearn.concurrent;

import java.util.concurrent.PriorityBlockingQueue;

/**
 * @author caiji Mr. Li
 * @date 2019/10/24 10:21
 */
public class PriorityBlockingQueueTest {
    public static void main(String[] args) {
        PriorityBlockingQueue<Integer> queue = new PriorityBlockingQueue();
        queue.offer(2);
        queue.offer(4);
        queue.offer(6);
        queue.offer(1);

        for (int i = 0; i < 4; i++) {
            Integer poll = queue.poll();
            System.out.println(poll);
        }
    }
}
